/*
 * Copyright (c) 2018-2999 湖南洛云网络科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.live.multishop.controller;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.enums.LiveInterfaceType;
import com.yami.shop.common.annotation.SysLog;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.live.comment.model.LiveLog;
import com.yami.shop.live.comment.model.LiveRoomProd;
import com.yami.shop.live.comment.param.LiveUsableNumParam;
import com.yami.shop.live.comment.service.LiveLogService;
import com.yami.shop.live.comment.service.LiveRoomProdService;
import com.yami.shop.security.multishop.util.SecurityUtils;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.Objects;


/**
 *
 *
 * @author lhd
 * @date 2020-08-05 08:53:17
 */
@RestController
@AllArgsConstructor
@RequestMapping("/live/liveRoomProd" )
public class LiveRoomProdController {

    private final LiveRoomProdService liveRoomProdService;
    private final LiveLogService liveLogService;


    /**
     * 查询商家今日剩余可用添加直播间商品次数
     */
    @GetMapping("/getAddRoomProdNum" )
    public ResponseEntity<LiveUsableNumParam> getAddRoomNum() {
        return ResponseEntity.ok(liveLogService.getLiveNum(SecurityUtils.getShopUser().getShopId(),LiveInterfaceType.IMPORT_ROOM_PROD));
    }

}
